package com.wanger.swc.config.myBatisPlus.autoDDL.model;

import com.wanger.swc.util.validation.MyVerifyUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author: wanger
 * @Date: 2024/10/4 20:47
 * @Description: 字段模型
 */
@Data
@NoArgsConstructor
@ApiModel("表字段")
public class MyColumn {

    @ApiModelProperty("数据库字段名")
    private String columnName;

    @ApiModelProperty("数据库字段类型")
    private String columnType;

    @ApiModelProperty("数据库字段java类型")
    private String columnJavaType;

    @ApiModelProperty("数据库字段注释")
    private String columnComment;

    public MyColumn(String columnName, String columnType, String columnJavaType, String columnComment) {
        MyVerifyUtil.nullVerify(columnName, "字段名不能为空！");
        MyVerifyUtil.nullVerify(columnType, "字段类型不能为空！");
        this.columnName = columnName.toLowerCase();
        this.columnType = columnType;
        this.columnJavaType = columnJavaType;
        this.columnComment = columnComment;
    }
}
